﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BusinessEntities.Model;
using System.Net.Mail;
using BusinessEntities;
namespace BusinessLayer
{
    public interface IBL
    {
        #region User Registration
        ModelValidationReport<BusinessEntities.Model.User> LoginUser(string email, string password);
        string CreateActivationHash(User user);
        User ValidateActivationHash(string hash, int userId);
        ModelValidationReport<User> CreateUser(User user);
        User GetUserByID(int id);
        User GetUserByEmail(string email);
        void ResendActivationEmail(int userid);
        List<User> GetAllUsers();
        void DeleteUser(User user);
        ModelValidationReport<User> UpdateUser(User user);
        #endregion
        
        #region Halls
        IEnumerable<Hall> GetAllHalls();
        Hall GetHallById(int id);
        #endregion

        #region Cities
        IEnumerable<City> GetCitiesByKeyWord(string keyWord);
        City GetCityByName(string name);
        City GetCityByID(int id);
        #endregion
        
        #region Events
        ModelValidationReport<Event> CreateEvent(Event aEvent);
        Event GetEventById(int id);
        IEnumerable<Event> GetUsersEvents(User user);
        EventReport GetEventReport(Event aEvent);
        void DeleteEvent(Event aEvent);
        ModelValidationReport<Event> UpdateEvent(Event _event);
        #endregion

        #region Guests
        Guest GetUsersGuestByEmail(string email, int userid);
        IEnumerable<Guest> GetUsersGuests(User user);
        ModelValidationReport<Guest> CreateGuest(Guest guest);
        Guest GetGuestByID(int id);
        IEnumerable<Invite> GetGuestsInvites(Guest g);
        IEnumerable<Guest> SearchForGuests(string keyword, int userid);
        IEnumerable<Guest> SearchForNonInvitedGuests(string keyword, int eventID, int p);
        decimal GetAverageGuestGifts(Guest guest);
        #endregion

        #region Helpers
        void SendMail(MailMessage message);
        #endregion

        #region Invites
        ModelValidationReport<Invite> CreateInvite(Invite invite);
        IEnumerable<Invite> GetInvitesByEvent(Event ev);
        Invite GetInviteByEventAndGuest(Event ev, Guest guest);
        ModelValidationReport<Invite> UpdateInvite(Invite invite);
        Invite GetInviteById(int id);
        Invite GetInviteByHash(string hash,int guestID);
        bool DeleteInvite(int eventID, int inviteID, int guestID);
        #endregion

    }
}
